• Print

Author Topic: Get a list of all usergroups  (Read 4282 times)

0 Members and 1 Guest are viewing this topic.

Offline simpleee

  • Newbie
  • *
  • Posts: 13
  • Karma: 1
Get a list of all usergroups
« on: October 11, 2015, 02:38:33 am »
Hello everyone.

Is it possible to get a list of all usergroups?

Tried to read the groups.txt, but it seems, that this isn't working.

Regards, ibot3

Offline Timmy

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 252
  • Karma: 168
  • Code monkey
Re: Get a list of all usergroups
« Reply #1 on: October 11, 2015, 03:09:08 am »
Yes!

ULib.ucl.groups stores permission data keyed by group name.

Code: Lua
  1. -- Print all group names
  2. for group in pairs(ULib.ucl.groups) do
  3.     print(group)
  4. end
« Last Edit: October 11, 2015, 03:13:39 am by Timmy »

Offline simpleee

  • Newbie
  • *
  • Posts: 13
  • Karma: 1
Re: Get a list of all usergroups
« Reply #2 on: October 11, 2015, 03:41:16 am »
Thank you :)

  • Print