Giving access to specific templates to all users

More
3 years 3 months ago #152487 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
The topic has been locked.
LimeSurvey Partners
More
3 years 2 months ago #155675 by DenisChenu
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 ;)

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.
More
1 year 5 months ago #180470 by wilberth
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);
The topic has been locked.

Start now!

Just create your account and start using Limesurvey today.

Register now