- Posts: 37
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Giving access to specific templates to all users
- terryaulenbach
- Topic Author
- Offline
- Junior Member
Less
More
6 years 11 months ago #152487
by terryaulenbach
Giving access to specific templates to all users was created by terryaulenbach
As far as I can tell, in Version 2.56.1+161118, access to specific templates has to be done on an individual basis. That is, I have to pull up a creator and give them access to templates individually. What I need to be able to do is select a template and give access to it to every user, current and future. Am I missing something? If not, I hope this feature will soon be added.
Terry
Terry
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13907
- Thank you received: 2546
6 years 9 months ago #155675
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Giving access to specific templates to all users
You can use
manual.limesurvey.org/BeforeHasPermission
and always return true id objet=='template' and sPermission=='yourtemplate'.
You can send false for all other template
You can send false for all other template
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- wilberth
- Offline
- New Member
Less
More
- Posts: 1
- Thank you received: 0
5 years 1 month ago #180470
by wilberth
Replied by wilberth on topic Giving access to specific templates to all users
I solved this with a database trigger. For each new user that is created the permission is given automatically. The following works for new users created with the LDAP plugin:
CREATE TRIGGER templatename AFTER INSERT ON users FOR EACH ROW INSERT INTO `permissions` (`uid`,`entity`,`permission`,`read_p`) VALUES (NEW.uid, 'template', 'templatename', 1);
CREATE TRIGGER templatename AFTER INSERT ON users FOR EACH ROW INSERT INTO `permissions` (`uid`,`entity`,`permission`,`read_p`) VALUES (NEW.uid, 'template', 'templatename', 1);
The topic has been locked.