diff --git a/source/java/org/alfresco/repo/jscript/People.java b/source/java/org/alfresco/repo/jscript/People.java index 5bd686b8ea..cc074c6e4b 100644 --- a/source/java/org/alfresco/repo/jscript/People.java +++ b/source/java/org/alfresco/repo/jscript/People.java @@ -441,6 +441,19 @@ public final class People extends BaseScopableProcessorExtension } return Context.getCurrentContext().newArray(getScope(), parents); } + + /** + * Return true if the specified user is an Administrator authority. + * + * @param person to test + * + * @return true if an admin, false otherwise + */ + public boolean isAdmin(ScriptNode person) + { + ParameterCheck.mandatory("Person", person); + return this.authorityService.isAdminAuthority((String)person.getProperties().get(ContentModel.PROP_USERNAME)); + } /** * Get Contained Authorities diff --git a/source/java/org/alfresco/repo/jscript/ScriptNode.java b/source/java/org/alfresco/repo/jscript/ScriptNode.java index 1e98e18920..967f6e542e 100644 --- a/source/java/org/alfresco/repo/jscript/ScriptNode.java +++ b/source/java/org/alfresco/repo/jscript/ScriptNode.java @@ -2434,6 +2434,18 @@ public class ScriptNode implements Serializable, Scopeable return result != null ? result : new Object[0]; } + /** + * Helper to return true if the supplied property value is a ScriptContentData object + * + * @param o Object to test + * + * @return true if instanceof ScriptContentData, false otherwise + */ + public boolean isScriptContent(Object o) + { + return (o instanceof ScriptContentData); + } + // ------------------------------------------------------------------------------ // Value Conversion diff --git a/source/java/org/alfresco/repo/template/BaseContentNode.java b/source/java/org/alfresco/repo/template/BaseContentNode.java index 57fd3286c9..5b70c83159 100644 --- a/source/java/org/alfresco/repo/template/BaseContentNode.java +++ b/source/java/org/alfresco/repo/template/BaseContentNode.java @@ -471,6 +471,18 @@ public abstract class BaseContentNode implements TemplateContent return (content != null ? content.getSize() : 0L); } + /** + * Helper to return true if the supplied property value is a TemplateContentData object + * + * @param o Object to test + * + * @return true if instanceof TemplateContentData, false otherwise + */ + public boolean isTemplateContent(Object o) + { + return (o instanceof TemplateContentData); + } + // ------------------------------------------------------------------------------ // Inner classes