07-15-2019 08:19 AM
I've programmatically created a site, but when logging in as a non-admin user, the discussion tab doesn't allow me to create a new topic, as shown in the attached snapshot, the button is disabled.
I presume this is a permission/role problem. Site node has the following permissions
ReadPermissions | GROUP_EVERYONE | ALLOWED |
SiteCollaborator | GROUP_site_scQnTQcSXo_SiteCollaborator | ALLOWED |
SiteConsumer | GROUP_site_scQnTQcSXo_SiteConsumer | ALLOWED |
SiteManager | GROUP_site_scQnTQcSXo_SiteManager | ALLOWED |
SiteContributor | GROUP_site_scQnTQcSXo_SiteContributor | ALLOWED |
admin user has no problem in creating a new topic. Surely at least the site owner should be able to create a new topic?
Any suggestions please? This is Alfresco 5.2.
07-15-2019 10:00 AM
As the permission levels states, if you are trying to create the topic in a site then the logged in user must have write access. i.e. use must be at least contributor. You have not mentioned the permission of the user which you are using to login. Please check the table below
Refer for more details:
https://docs.alfresco.com/5.2/references/permissions_share_components.html
https://docs.alfresco.com/5.2/references/permissions_share_other.html
07-15-2019 10:49 AM
Thanks for the info. That does seem crystal clear doesn't it?
There's still something weird going on though, because I just changed the user's permission to 'Collaborator', and still can't create a new topic.
07-15-2019 11:39 AM
Hmm, Do you see any logs or errors while creating the topics by Collaborator user ? Can you check share.log, alfresco.log and catalina.out log
Another test to do, create another user. Add the user to the site as a manager and try to create the topic. Just to double check the permission issues.
07-16-2019 05:47 AM
Well this is interesting, because I just created a new user, and added the user to the site. Result - user can't create a new topic, even though I added them as a contributor.
Only user who can create a new topic at the moment is admin.
07-16-2019 09:33 AM
This is from
share/src/main/resources/alfresco/site-webscripts/org/alfresco/components/discussions/toolbar.get.js
var toolbar = {
id : "DiscussionsToolbar",
name : "Alfresco.DiscussionsToolbar",
options : {
siteId : (page.url.templateArgs.site != null) ? page.url.templateArgs.site : "",
containerId : (page.url.args.containerId != null) ? page.url.args.containerId : "discussions",
allowCreate : model.forum.forumPermissions.create
}
};
model.widgets = [toolbar];
So the 'allowCreate' property appears to be false.
Question is, what is setting model.forum.forumPermissions.create to false?
07-17-2019 08:55 AM
Ok for the benefit of anyone else reading this, we got to the bottom of it.
We're programmatically creating a new site, using a site preset, which includes the 'discussion' page on the site dashboard toolbar.
As described above, nobody except Admin user could create a new topic after the site was initially created. The reason for this was the 'discussion' node doesn't exist, until someone creates a topic. Thereafter, anyone with Collaborator or Contributor role can create a new topic.
Basically we added some code to the site creation webscript service, which specifically creates the discussions node, under the newly created site node. The folder has to be called "discussions", and you can use the defined static constant as the name of the node -
DiscussionServiceImpl.DISCUSSION_COMPONENT
Explore our Alfresco products with the links below. Use labels to filter content by product module.