本文整理汇总了Java中org.alfresco.repo.site.SiteModel类的典型用法代码示例。如果您正苦于以下问题:Java SiteModel类的具体用法?Java SiteModel怎么用?Java SiteModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SiteModel类属于org.alfresco.repo.site包,在下文中一共展示了SiteModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getTotalEstimatedWorkSize
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
@Override
public synchronized int getTotalEstimatedWorkSize()
{
if (maxId == Long.MAX_VALUE)
{
maxId = patchDAO.getMaxAdmNodeID();
if (logger.isDebugEnabled())
{
logger.debug("\tQ: Max node id: " + maxId);
}
}
if (workCount == Long.MAX_VALUE)
{
// get the sites count
workCount = patchDAO.getCountNodesWithTypId(SiteModel.TYPE_SITE);
// Each site has 12 children (we care only about surf-config
// itself and its children)
workCount *= 12;
if (logger.isDebugEnabled())
{
logger.debug("\tQ: Work count: " + workCount);
}
}
return (int) workCount;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:SurfConfigFolderPatch.java
示例2: getPathFromSites
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
@Override
public String getPathFromSites(final NodeRef ref)
{
return doAsSystem(new RunAsWork<String>()
{
@Override
public String doWork() throws Exception
{
String name = ((String) nodeService.getProperty(ref, ContentModel.PROP_NAME)).toLowerCase();
if (nodeService.getType(ref).equals(SiteModel.TYPE_SITE))
{
return name;
}
else
{
NodeRef parent = nodeService.getPrimaryParent(ref).getParentRef();
return getPathFromSites(parent) + "/" + name;
}
}
});
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:ImapServiceImpl.java
示例3: init
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
/**
* Checks that all necessary properties and services have been provided.
*/
public void init()
{
PropertyCheck.mandatory(this, "nodeService", nodeService);
PropertyCheck.mandatory(this, "WorkflowService", workflowService);
PropertyCheck.mandatory(this, "ActionService", actionService);
PropertyCheck.mandatory(this, "PersonService", personService);
PropertyCheck.mandatory(this, "SiteService", siteService);
PropertyCheck.mandatory(this, "AuthenticationService", authenticationService);
PropertyCheck.mandatory(this, "PermissionService", permissionService);
PropertyCheck.mandatory(this, "NamespaceService", namespaceService);
PropertyCheck.mandatory(this, "NodeService", nodeService);
PropertyCheck.mandatory(this, "UserNameGenerator", usernameGenerator);
PropertyCheck.mandatory(this, "PasswordGenerator", passwordGenerator);
PropertyCheck.mandatory(this, "PolicyComponent", policyComponent);
PropertyCheck.mandatory(this, "templateService", templateService);
this.inviteNominatedSender = new InviteNominatedSender(serviceRegistry, repositoryHelper, messageService);
this.inviteModeratedSender = new InviteModeratedSender(serviceRegistry, repositoryHelper, messageService);
//
this.policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "beforeDeleteNode"),
SiteModel.TYPE_SITE, new JavaBehaviour(this, "beforeDeleteNode"));
this.policyComponent.bindClassBehaviour(BeforeDeleteNodePolicy.QNAME, ContentModel.TYPE_PERSON, new JavaBehaviour(this, "beforeDeleteNode"));
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:28,代码来源:InvitationServiceImpl.java
示例4: cancelInvitation
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
@Override
public void cancelInvitation(String siteName, String invitee, String inviteId, String currentInviteId)
{
if (!AuthenticationUtil.isRunAsUserTheSystemUser())
{
String currentUserName = authenticationService.getCurrentUserName();
String currentUserSiteRole = siteService.getMembersRole(siteName, currentUserName);
if (SiteModel.SITE_MANAGER.equals(currentUserSiteRole)== false)
{
// The current user is not the site manager
Object[] args = {currentUserName, inviteId, siteName};
throw new InvitationExceptionForbidden(MSG_NOT_SITE_MANAGER, args);
}
}
// Clean up invitee's user account and person node if they are not in use i.e.
// account is still disabled and there are no pending invites outstanding for the
// invitee
deleteAuthenticationIfUnused(invitee, currentInviteId);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:InvitationServiceImpl.java
示例5: addAndUpdateMemberships
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
protected void addAndUpdateMemberships(String siteId, boolean includeUser4) throws Exception
{
// add member -> join site
addMembership(siteId, user1, SiteModel.SITE_CONSUMER);
addMembership(siteId, user2, SiteModel.SITE_MANAGER);
addMembership(siteId, user3, SiteModel.SITE_COLLABORATOR);
if (includeUser4) { addMembership(siteId, user4, SiteModel.SITE_CONSUMER); }
// update member -> change role
updateMembership(siteId, user1, SiteModel.SITE_MANAGER);
updateMembership(siteId, user2, SiteModel.SITE_COLLABORATOR);
updateMembership(siteId, user3, SiteModel.SITE_CONSUMER);
if (includeUser4) { updateMembership(siteId, user4, SiteModel.SITE_COLLABORATOR); }
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:AbstractSiteActivityTest.java
示例6: ensureUsersWithShareRolesArePresentAndCorrect
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
@Test public void ensureUsersWithShareRolesArePresentAndCorrect() throws Exception
{
TRANSACTION_HELPER.doInTransaction(new RetryingTransactionCallback<Void>()
{
public Void execute() throws Throwable
{
final String shortName = testSiteWithMembers.siteInfo.getShortName();
final SiteInfo recoveredSite = SITE_SERVICE.getSite(shortName);
assertNotNull("Test site does not exist", recoveredSite);
assertEquals(SiteModel.SITE_MANAGER, SITE_SERVICE.getMembersRole(shortName, testSiteWithMembers.siteManager));
assertEquals(SiteModel.SITE_COLLABORATOR, SITE_SERVICE.getMembersRole(shortName, testSiteWithMembers.siteCollaborator));
assertEquals(SiteModel.SITE_CONTRIBUTOR, SITE_SERVICE.getMembersRole(shortName, testSiteWithMembers.siteContributor));
assertEquals(SiteModel.SITE_CONSUMER, SITE_SERVICE.getMembersRole(shortName, testSiteWithMembers.siteConsumer));
assertNotNull(testSiteWithMembers.doclib);
assertTrue("Site doclib was not pre-created.", NODE_SERVICE.exists(testSiteWithMembers.doclib));
assertEquals("Site doclib was in wrong place.", testSiteWithMembers.siteInfo.getNodeRef(),
NODE_SERVICE.getPrimaryParent(testSiteWithMembers.doclib).getParentRef());
return null;
}
});
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:TemporarySitesTest.java
示例7: getFilterPropListOfSites
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
private List<FilterProp> getFilterPropListOfSites(final Parameters parameters)
{
List<FilterProp> filterProps = new ArrayList<FilterProp>();
Query q = parameters.getQuery();
if (q != null)
{
MapBasedQueryWalkerOrSupported propertyWalker = new MapBasedQueryWalkerOrSupported(LIST_SITES_EQUALS_QUERY_PROPERTIES, null);
QueryHelper.walk(q, propertyWalker);
String siteVisibilityStr = propertyWalker.getProperty(PARAM_VISIBILITY, WhereClauseParser.EQUALS, String.class);
if (siteVisibilityStr != null && !siteVisibilityStr.isEmpty())
{
SiteVisibility siteVisibility = getSiteVisibilityFromParam(siteVisibilityStr);
filterProps.add(new FilterPropString(SiteModel.PROP_SITE_VISIBILITY, siteVisibility.name(), FilterPropString.FilterTypeString.EQUALS));
}
String sitePreset = propertyWalker.getProperty(PARAM_PRESET, WhereClauseParser.EQUALS, String.class);
if (sitePreset != null && !sitePreset.isEmpty())
{
filterProps.add(new FilterPropString(SiteModel.PROP_SITE_PRESET, sitePreset, FilterPropString.FilterTypeString.EQUALS));
}
}
// expected null or non-empty list
return filterProps.isEmpty() ? null : filterProps;
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:27,代码来源:SitesImpl.java
示例8: testGetMembership
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
public void testGetMembership() throws Exception
{
// Create a site
String shortName = GUID.generate();
createSite("myPreset", shortName, "myTitle", "myDescription", SiteVisibility.PUBLIC, 200);
// Test error conditions
sendRequest(new GetRequest(URL_SITES + "/badsite" + URL_MEMBERSHIPS + "/" + USER_ONE), 404);
sendRequest(new GetRequest(URL_SITES + "/" + shortName + URL_MEMBERSHIPS + "/baduser"), 404);
sendRequest(new GetRequest(URL_SITES + "/" + shortName + URL_MEMBERSHIPS + "/" + USER_TWO), 404);
Response response = sendRequest(new GetRequest(URL_SITES + "/" + shortName + URL_MEMBERSHIPS + "/" + USER_ONE), 200);
JSONObject result = new JSONObject(response.getContentAsString());
// Check the result
assertEquals(SiteModel.SITE_MANAGER, result.get("role"));
assertEquals(USER_ONE, result.getJSONObject("authority").get("userName"));
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:19,代码来源:SiteServiceTest.java
示例9: testDeleteMembership
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
public void testDeleteMembership() throws Exception
{
// Create a site
String shortName = GUID.generate();
createSite("myPreset", shortName, "myTitle", "myDescription", SiteVisibility.PUBLIC, 200);
// Build the JSON membership object
JSONObject membership = new JSONObject();
membership.put("role", SiteModel.SITE_CONSUMER);
JSONObject person = new JSONObject();
person.put("userName", USER_TWO);
membership.put("person", person);
// Post the membership
sendRequest(new PostRequest(URL_SITES + "/" + shortName + URL_MEMBERSHIPS, membership.toString(), "application/json"), 200);
// Delete the membership
sendRequest(new DeleteRequest(URL_SITES + "/" + shortName + URL_MEMBERSHIPS + "/" + USER_TWO), 200);
// Check that the membership has been deleted
sendRequest(new GetRequest(URL_SITES + "/" + shortName + URL_MEMBERSHIPS + "/" + USER_TWO), 404);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:24,代码来源:SiteServiceTest.java
示例10: testMultipleInviteRequests
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
public void testMultipleInviteRequests() throws Exception
{
String shortName = GUID.generate();
createSite("myPreset", shortName, "myTitle", "myDescription", SiteVisibility.MODERATED, 200);
String userName = USER_TWO;
String roleName = SiteModel.SITE_CONSUMER;
String inviteComments = "Request to join";
try {
//Create a new moderated invitation
String moderatedInvitationId = createModeratedInvitation(shortName, inviteComments, userName, roleName);
//Create another invitation
String newModeratedInvitationId = createModeratedInvitation(shortName, inviteComments, userName, roleName);
fail("A request to join this site is already in pending");
}
catch (AssertionFailedError e) {
// Ignore since we where expecting this
}
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:20,代码来源:SiteServiceTest.java
示例11: setUp
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
@Override
protected void setUp() throws Exception
{
super.setUp();
this.authenticationService = (MutableAuthenticationService)getServer().getApplicationContext().getBean("AuthenticationService");
this.authenticationComponent = (AuthenticationComponent)getServer().getApplicationContext().getBean("authenticationComponent");
this.personService = (PersonService)getServer().getApplicationContext().getBean("PersonService");
this.siteService = (SiteService)getServer().getApplicationContext().getBean("SiteService");
this.nodeArchiveService = (NodeArchiveService)getServer().getApplicationContext().getBean("nodeArchiveService");
this.activityService = (ActivityService)getServer().getApplicationContext().getBean("activityService");
ChildApplicationContextFactory activitiesFeed = (ChildApplicationContextFactory)getServer().getApplicationContext().getBean("ActivitiesFeed");
ApplicationContext activitiesFeedCtx = activitiesFeed.getApplicationContext();
this.feedGenerator = (FeedGenerator)activitiesFeedCtx.getBean("feedGenerator");
this.postLookup = (PostLookup)activitiesFeedCtx.getBean("postLookup");
// Authenticate as user
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
// Create test site
// - only create the site if it doesn't already exist
SiteInfo siteInfo = this.siteService.getSite(SITE_SHORT_NAME_BLOG);
if (siteInfo == null)
{
this.siteService.createSite("BlogSitePreset", SITE_SHORT_NAME_BLOG, "BlogSiteTitle", "BlogSiteDescription", SiteVisibility.PUBLIC);
}
// Create users
createUser(USER_ONE, SiteModel.SITE_COLLABORATOR, SITE_SHORT_NAME_BLOG);
createUser(USER_TWO, SiteModel.SITE_COLLABORATOR, SITE_SHORT_NAME_BLOG);
// Blank our lists used to track things the test creates
posts = new ArrayList<String>(5);
drafts = new ArrayList<String>(5);
// Do tests as inviter user
this.authenticationComponent.setCurrentUser(USER_ONE);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:39,代码来源:BlogServiceTest.java
示例12: addAndUpdateMemberships
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
protected void addAndUpdateMemberships(String siteId, String ticket, boolean includeUser4) throws Exception
{
// add member -> join site
addMembership(siteId, user1, ticket, SiteModel.SITE_CONSUMER);
addMembership(siteId, user2, ticket, SiteModel.SITE_MANAGER);
addMembership(siteId, user3, ticket, SiteModel.SITE_COLLABORATOR);
if (includeUser4) { addMembership(siteId, user4, ticket, SiteModel.SITE_CONSUMER); }
// update member -> change role
updateMembership(siteId, user1, ticket, SiteModel.SITE_MANAGER);
updateMembership(siteId, user2, ticket, SiteModel.SITE_COLLABORATOR);
updateMembership(siteId, user3, ticket, SiteModel.SITE_CONSUMER);
if (includeUser4) { updateMembership(siteId, user4, ticket, SiteModel.SITE_COLLABORATOR); }
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:17,代码来源:SiteActivitySystemTest.java
示例13: testMNT13234
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
public void testMNT13234() throws Exception
{
// as admin
String ticket = callLoginWebScript(WEBSCRIPT_ENDPOINT, ADMIN_USER, ADMIN_PW);
assertNotNull(ticket);
// create users (should contain uppercase letter)
String testid = ""+System.currentTimeMillis();
String user1 = "User1_" + testid;
String user2 = "User2_" + testid;
createUser(ticket, user1, USER_PW);
createUser(ticket, user2, USER_PW);
addFollower(user1, user2, ticket);
// create site and add memberships
String site1 = "test_site1_" + testid;
createSite(site1, true, ticket);
addMembership(site1, user1, ticket, SiteModel.SITE_CONSUMER);
addMembership(site1, user2, ticket, SiteModel.SITE_CONSUMER);
Thread.sleep(DELAY_MSECS);
addFeedControl(user1, site1, null, ticket);
getUserFeed(user1, ticket, true, 2);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:26,代码来源:SiteActivitySystemTest.java
示例14: findList
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
/**
* For a given node, looks up the parent tree to find the List
* (Site Container) that it is part of.
*
* @param itemInList the nodeRef of item to look parent container for
* @return the nodeRef of the list this item is part of, or the node itself if it isn't in one
*/
public NodeRef findList(NodeRef itemInList)
{
NodeRef result = null;
NodeRef nodeToCheck = itemInList;
while (result == null && nodeToCheck != null)
{
if (nodeService.hasAspect(nodeToCheck, SiteModel.ASPECT_SITE_CONTAINER))
{
result = nodeToCheck;
break;
}
else
{
nodeToCheck = nodeService.getPrimaryParent(nodeToCheck).getParentRef();
}
}
if (result == null)
{
return itemInList;
}
return result;
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:32,代码来源:VtiPathHelper.java
示例15: getSiteName
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
private String getSiteName(NodeRef nodeRef)
{
NodeRef parent = nodeService.getPrimaryParent(nodeRef).getParentRef();
while (parent != null && !nodeService.getType(parent).equals(SiteModel.TYPE_SITE))
{
// check that we can read parent name
String parentName = (String) nodeService.getProperty(parent, ContentModel.PROP_NAME);
if (nodeService.getPrimaryParent(nodeRef) != null)
{
parent = nodeService.getPrimaryParent(parent).getParentRef();
}
}
if (parent == null)
{
return null;
}
return nodeService.getProperty(parent, ContentModel.PROP_NAME).toString();
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:22,代码来源:QuickShareServiceImpl.java
示例16: testWorkflowTaskContainsProps
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
public void testWorkflowTaskContainsProps()
{
Invitation.ResourceType resourceType = Invitation.ResourceType.WEB_SITE;
String resourceName = SITE_SHORT_NAME_INVITE;
String inviteeRole = SiteModel.SITE_COLLABORATOR;
String serverPath = "wibble";
String acceptUrl = "froob";
String rejectUrl = "marshmallow";
NominatedInvitation nomInvite = invitationService.inviteNominated(USER_ONE,
resourceType, resourceName, inviteeRole, serverPath, acceptUrl, rejectUrl);
WorkflowTask task = getTaskForInvitation(nomInvite);
Map<QName, Serializable> props = task.getProperties();
assertEquals(inviteeRole, props.get(WorkflowModelNominatedInvitation.WF_PROP_INVITEE_ROLE));
assertEquals(nomInvite.getResourceDescription(), props.get(WorkflowModelNominatedInvitation.WF_PROP_RESOURCE_DESCRIPTION));
assertEquals(nomInvite.getResourceTitle(), props.get(WorkflowModelNominatedInvitation.WF_PROP_RESOURCE_TITLE));
// Accept the invitation
invitationService.accept(nomInvite.getInviteId(), nomInvite.getTicket());
task = workflowService.getTaskById(task.getId());
props = task.getProperties();
assertEquals(inviteeRole, props.get(WorkflowModelNominatedInvitation.WF_PROP_INVITEE_ROLE));
assertEquals(nomInvite.getResourceDescription(), props.get(WorkflowModelNominatedInvitation.WF_PROP_RESOURCE_DESCRIPTION));
assertEquals(nomInvite.getResourceTitle(), props.get(WorkflowModelNominatedInvitation.WF_PROP_RESOURCE_TITLE));
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:27,代码来源:ActivitiInvitationServiceImplTests.java
示例17: isSitesSpace
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
/**
* Determines whether the current space is a 'Sites' space
*
* @return true if the current space is a 'Sites' space
*/
public boolean isSitesSpace()
{
boolean siteSpace = false;
Node currentNode = this.navigator.getCurrentNode();
if (currentNode != null)
{
// check the type of the node to see if it is a 'site' related space
QName currentNodeType = currentNode.getType();
if (SiteModel.TYPE_SITES.isMatch(currentNodeType) ||
SiteModel.TYPE_SITE.isMatch(currentNodeType) ||
getDictionaryService().isSubClass(currentNodeType, SiteModel.TYPE_SITE))
{
siteSpace = true;
}
}
return siteSpace;
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:26,代码来源:BrowseBean.java
示例18: onUpdateProperties
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
/**
* Ensure that the visibility of a RM site can not be changed to anything but public.
*
* TODO support other site visibilities
*
* @see org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy#onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef, java.util.Map, java.util.Map)
*/
@Behaviour
(
kind = BehaviourKind.CLASS,
notificationFrequency = NotificationFrequency.FIRST_EVENT
)
public void onUpdateProperties(NodeRef nodeRef, Map<QName, Serializable> before, Map<QName, Serializable> after)
{
if (nodeService.exists(nodeRef))
{
Map<QName, Serializable> changed = PropertyMap.getChangedProperties(before, after);
if (changed.containsKey(SiteModel.PROP_SITE_VISIBILITY) &&
changed.get(SiteModel.PROP_SITE_VISIBILITY) != null &&
!SiteVisibility.PUBLIC.equals(changed.get(SiteModel.PROP_SITE_VISIBILITY)))
{
// we do not current support non-public RM sites
throw new AlfrescoRuntimeException("The records management site must have public visibility. It can't be changed to " + changed.get(SiteModel.PROP_SITE_VISIBILITY));
}
}
}
开发者ID:Alfresco,项目名称:records-management-old,代码行数:27,代码来源:RmSiteType.java
示例19: setupCollaborationSiteTestDataImpl
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
/**
* @see org.alfresco.module.org_alfresco_module_rm.test.util.BaseRMTestCase#setupCollaborationSiteTestDataImpl()
*/
@Override
protected void setupCollaborationSiteTestDataImpl()
{
super.setupCollaborationSiteTestDataImpl();
String collabSiteId2 = GUID.generate();
siteService.createSite("site-dashboard", collabSiteId2, GUID.generate(), GUID.generate(), SiteVisibility.PUBLIC);
documentLibrary2 = SiteServiceImpl.getSiteContainer(
collabSiteId2,
SiteService.DOCUMENT_LIBRARY,
true,
siteService,
transactionService,
taggingService);
assertNotNull("Collaboration site document library component was not successfully created.", documentLibrary2);
user = GUID.generate();
createPerson(user);
siteService.setMembership(collabSiteId, user, SiteModel.SITE_CONTRIBUTOR);
siteService.setMembership(collabSiteId2, user, SiteModel.SITE_CONTRIBUTOR);
siteService.setMembership(siteId, user, SiteModel.SITE_CONSUMER);
filePlanRoleService.assignRoleToAuthority(filePlan, FilePlanRoleService.ROLE_POWER_USER, user);
}
开发者ID:Alfresco,项目名称:records-management-old,代码行数:28,代码来源:RM978Test.java
示例20: canEditPermission
import org.alfresco.repo.site.SiteModel; //导入依赖的package包/类
private boolean canEditPermission(NodeRef commentNodeRef)
{
String creator = (String)nodeService.getProperty(commentNodeRef, ContentModel.PROP_CREATOR);
Serializable owner = nodeService.getProperty(commentNodeRef, ContentModel.PROP_OWNER);
String currentUser = AuthenticationUtil.getFullyAuthenticatedUser();
boolean isSiteManager = permissionService.hasPermission(commentNodeRef, SiteModel.SITE_MANAGER) == (AccessStatus.ALLOWED);
boolean isCoordinator = permissionService.hasPermission(commentNodeRef, PermissionService.COORDINATOR) == (AccessStatus.ALLOWED);
return (isSiteManager || isCoordinator || currentUser.equals(creator) || currentUser.equals(owner));
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:11,代码来源:CommentServiceImpl.java
注:本文中的org.alfresco.repo.site.SiteModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论