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
  • terryaulenbach's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 7 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
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
7 years 5 months ago #155675 by DenisChenu
Replied by DenisChenu on topic Giving access to specific templates to all users
You can use www.limesurvey.org/manual/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 support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
5 years 9 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.
Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose