LuxCal Forum

The place for questions, suggestions and news about the LuxCal Event Calendar

User:   Password:   Remember Me?   
LuxCal Forum / General / Support / Category Permissions
Posted:  01 Jan 2017 16:36
I have installed a fresh calendar and am testing it i have created a user with a group that can only see and edit 1 category but they can still see other events with other categories and still post with all categories

please can you help with this

Posted:  01 Jan 2017 17:40
Hello Geraint,

Let's see if I can help. I need to get some details which might help solve what you are trying to accomplish.

Do you have self registration enabled?

If you do, what group do they get assigned to? If they are assigned to "Post Own" then they can Post/edit their own events.

In the "User's" section, check to make sure the user is assigned to the user group you created. Also make sure that the user "Public Access" is set to "No access".

"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at
Posted:  01 Jan 2017 17:47
Hi Dan

Thanks for trying to help.

Yes i do have self registration enabled - set to no access as  i change it once i have checked the registration.

this is a test user i created for testing the features.

The test user was first assigned to post own and assigned to a new group i created with access to view and add 1 category only
public access is assigned no access

i created a few events as me first as a different cat that was not given to the test user.

i then logged in as the test user and can see all the other events and can create a event in any cat on the calendar.

stuck at this point

Posted:  02 Jan 2017 02:03
Hi Roel,

I registered at Geraint's calendar and he upgraded me to admin status when I tried to login I got this message on a blank page.

not permitted (CSRF)

On my own calendar with using the SQLite version I created a category called "Limit 1". I then created a user group called "Limit 1 Category" a checked View/Add only for "Limit 1".

With "Self registration" checked I registered with new registrations automatically in the "Limit 1 Category". When I logged in as testuser2 I could add an event to the other category even though I shouldn't be able too.

"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at
Posted:  02 Jan 2017 10:35
Hello Dan

Have You checked the "public users" rights ?

I wish all a happy and peaceful new year

Posted:  02 Jan 2017 14:35
I just went and checked public rights and it is set at no access but the categories in that user group is view/add all categories but it will not allow me to no select nothing so i selected just one of the categories and that did it now can only select the one cat in the restriced group and the 1 public cat.  would be good if we could unselect all for the public category rather that either view.add all or pic a cat

looks like this is solved but could do with a slight tweek

Posted:  02 Jan 2017 15:07   Last Edited By: Danwestlake
Hello John,

Happy New Year sir.


Have You checked the "public users" rights ?

I have public access disabled since it is a personal calendar. The public doesn't need access.

It appears Geraint has found a work around solution by enabling Public Access. In some ways I can understand it. If Public Access isn't allowed why would you restrict categories. I guess there might be a situation where you might not want Public Access and still restrict users to posting in certain categories.

"Little Guy"
Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at
Posted:  02 Jan 2017 15:51
I have public access set to no access but you can still change the permissions of the no access group to either all view/add or select a cat, looks like even though it is set to no access those cat permissions still effect the calendar but you cant unselect all the categories you have to have something selected

Posted:  02 Jan 2017 17:00
i have done further tests and i can get this to work now by changing the no access cat permissions, but we need to be able to unselect all categories for this group or make it when no access is selected it removes all categories access as it does not effect users assigned that group because they have no access but it gives extra permissions to other users of other groups as they get their own permissions and the no access group permissions.

Posted:  02 Jan 2017 20:29
hi dan

for the no assess group i cant unselect all the categories i have to have either 1 cat selected or the all cat one selected
Posted:  02 Jan 2017 21:54
Hello geraint

You could have a dummy-category and set this category as the only allowed for the public, and then disable public access.

there is some logic in, that if the public user has access to a category, then all users should have access to this category.

Hope You will have it to work.

Kind regards
Posted:  02 Jan 2017 21:59
And hello again

Does the no-cat on the user group not function for You ?

Kind regards
Posted:  02 Jan 2017 22:14
Hello Schwartz

this helps for the public user, but all other users groups gets the pubic permission too

so if public has cat 1 on view and add

then user 1 has cat 2, but he will also get cat 1 as well from the public or no access group so even if the public user is disabled all the other users will get its permissions

i will try and find a way to get it to work like you say create a dummy cat but it would be handy if the public option is set at no access then it has no cats enabled as its a private use calendar so no public users will use it

maybe roel could find a way i could edit a file to allow this if he does not want to make the change for everyone

but thanks for everyones help got there in the end

Posted:  03 Jan 2017 16:42   Last Edited By: Roel B.
Ok guys, I've analyzed the problem and found that due to a bug, whenever the public user has "No access" rights, all other users could view/edit all event categories, even though the number of categories that can be viewed/edited has been limited in the user group of the user.
This bug can be solved by editing the index.php file in the calendar root and by changing lines 135 and 136 from . . .


    if ($usr['vCats'] != '0') { $usr['vCats'] = $row['vCats'] == '0' ? '0' : $usr['vCats'].','.$row['vCats']; } //view categories
    if ($usr['eCats'] != '0') { $usr['eCats'] = $row['eCats'] == '0' ? '0' : $usr['eCats'].','.$row['eCats']; } //edit categories
into . . .


    if ($usr['vCats'] != '0' and $row['privs'] > 0) { $usr['vCats'] = $row['vCats'] == '0' ? '0' : $usr['vCats'].','.$row['vCats']; } //view categories
    if ($usr['eCats'] != '0' and $row['privs'] > 1) { $usr['eCats'] = $row['eCats'] == '0' ? '0' : $usr['eCats'].','.$row['eCats']; } //edit categories

(Within the first pair of brackets " and $row['privs'] > x" has been added)

Please be aware of the following: A registered user can always at least view/ edit the categories a Public user can view/ edit! So for example, if a registered user is part of a group for which the admin specified that only categories 3 and 4 can be viewed, but the public user can view categories 1, 2 and 3 (and has at least view rights), then the registered user will be able to see categories 1, 2, 3 and 4.

I hope this is clear. Please let me know if this solved the problem.

PS. Tonight I will delete a couple of post from this thread, which now appear to be irrelevant, to make the thread better readable for other users.
Posted:  06 Jan 2017 23:30   Last Edited By: geraintw1uk
Hi roel

sorry for the late reply,

just tried this and i dont know if it is working or not

i have set the public  view and add of no cat
and the test user view and add of cat 1

logged in as the test user and tried posting event as cat 1 it worked fine
tried event in no cat and it allowed me to do the event but when i click add to add the event it said event added but did not add the event is this intended behaviour i thought it would just not show the no cat if it is not going to allow you to post or view it

Posted:  15 Jan 2017 22:56
I had a look at Geraint's index.php file and saw that Geraint made a small mistake when implementing the fix in my post above.
If the fix is applied correctly, it solves the problem.
Posted:  18 Jan 2017 22:08
Hi Roel,

I had the same problem described in this post. I also edited index.php as proposed.
I am seeing the following beavior:

Whenever edit rights in a user group are limited it is not possible for a user in this group to create a new event. A window opens with "No edit rights (event) text. When changing edit rights to "all categories" everything works but wtih all categories enabled.
Viewing rights are working as expected. I can limit the displayed cats.

My configuration:

Public Access --> No Access
User 1 --> Group 1
User 2 --> Group 2

User Groups
No access --> No access rights
Group1 --> Post/Edit own events, view and edit limited to two categories
Group2 --> Post/Edit own events, view and edit limited to two categories

There is another stupid effect: I can easily add user groups, but deleting is not possible. I get an error message from the browser "The requested URL /index({delEXE:'y',gid.x}); was not found on this server". I post this here becaus i am nut sure if this has somthing to do with the problem mentioned above.

Beside these two problems everything works fine for me.

Posted:  20 Jan 2017 22:30
Hi Werber,

You are probably not using the latest LuxCal version.
The last problem you described (not possible to delete user groups) was a bug which was solved in version 4.5.1.