1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 Permissions Issue

Discussion in 'Troubleshooting and Problems' started by Donnie La Curan, Apr 11, 2013.

  1. Donnie La Curan

    Donnie La Curan Active Member

    I have 2 user groups. The first one is the Registered group that is default. The next group is a Members group. I set up a User Group Promotion so that when a user hit 5 posts they were placed in the Members group.

    The only difference between these 2 groups is the permissions on 2 forums. Registered are not allowed to start threads in these 2 forums. Members can start threads.

    This appeared to be working as I've had a test account under 5 posts and it was not able to post. I have looked at the forum as other users who have over 5 posts and they can post. Today I had a user ask me why they can't post in those forums. I looked and they are in the Registered group and secondary Members. They have 285 posts. They don't have any special permissions.

    I can't see why this one user can't get in. Is there something I am doing wrong?

    edit: I am testing permissions on other users and I am seeing the same problem. So some users can start threads and others can't. Though they all appear to have the same permissions.

    edit: I looked in the database and I can see a lot of users who are not in the secondary Members group who have over 5 posts.
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Is this from an import or are they newly registered members after you installed the forum?
     
  3. Donnie La Curan

    Donnie La Curan Active Member

    The users are from an import. I created the user group Members after the import and then created the promotion.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    I have encountered problems with incorrect permissions related to imported users before.

    Are you comfortable with working in the database?
    If so you can check the xf_user table and compare the records of two members; one which is working and one which isn't.
    If the user_group_id, secondary_group_ids and permission_combination_id fields are the same then at least you can rule that out.
     
  5. Donnie La Curan

    Donnie La Curan Active Member

    This query shows 124 users:
    Code:
    SELECT * FROM `xf_user` where secondary_group_ids like '%11%'
    This query shows 6,452 users:
    Code:
    SELECT * FROM `xf_user` where user_group_id = 2 and secondary_group_ids = '' and message_count >= 5
    Most of the users are not in the appropriate group. Shouldn't all of these users be in the secondary group?

    I queried 3 different users.

    User 1 - user_group_id = 2, secondary_group_ids = 11, permission_combination_id = 25
    User 2 - user_group_id = 2, secondary_group_ids = blank, permission_combination_id = 2
    User 2 - user_group_id = 2, secondary_group_ids = 11, permission_combination_id = 25

    Actually now that I am looking at it more. The threads I am seeing are from before I imported. Nobody can start a new thread. People can only reply.
     
  6. Donnie La Curan

    Donnie La Curan Active Member

    I think the permission_combination_id is incorrect.

    I changed it on one user to equal all of the users group ids added together and they have permission.

    I am not entirely sure that's how it works or not. But changing that number to 13 instead of 25 worked.

    edit: I just tried editing a user. I removed their secondary group and looked, permission_combination_id went to 2. Then I edited them again and refreshed the database and permission_combination_id went back to 25.
     
  7. Donnie La Curan

    Donnie La Curan Active Member

    I looked in this table xf_permission_combination_user_group and see a bunch of entries for the same user_group_id.

    Code:
    "1","1"
    "2","2"
    "3","3"
    "4","4"
    "2","5"
    "3","5"
    "2","6"
    "3","6"
    "4","6"
    "3","13"
    "4","13"
    "2","14"
    "4","15"
    "4","18"
    "4","19"
    "4","24"
    "2","25"
    "11","25"
    "4","26"
    "11","26"
    "4","27"
    "11","27"
    "4","28"
    "11","28"
    "4","29"
    "11","29"
    "4","30"
    "11","30"
    "4","31"
    "11","31"
    "2","32"
    "3","32"
    "4","32"
    "11","32"
    "2","33"
    "11","33"
     
  8. Donnie La Curan

    Donnie La Curan Active Member

    I rebuilt the user cache and it didn't do anything. They still end up with the same permissions.
     
  9. Donnie La Curan

    Donnie La Curan Active Member

    I think part of this is resolved. The permissions part of it.

    I thought that since the Member group was allowed to start threads that it would apply to the forums that I said Registered could not start threads. So I applied a node permission for the Member group to allow start threads on those 2 forums and now they can.

    However, I still have a problem with the number of users in the Members group. I updated the promotion to only promote those people in the Registered group ... which covers everyone it should. According to the query I posted above, I still have 6,452 users who should be in that group but are not. After I updated the permission I ran the cron to update permissions. No change.

    So the users in the Members group can now post in the 2 forums. However, there are still ~6400 users who should be able to but can't.

    Can I just run a query to update their records to match a user who does have permission? If I do will it get set back when the user group promotion runs?
     
  10. Donnie La Curan

    Donnie La Curan Active Member

    So I did a search in the users area for the same criteria as the promotion and it comes back with the number of users that should be in that group, ~6500.

    Wonder why the promotion isn't working for most users.
     
  11. Sheratan

    Sheratan Well-Known Member

    I think the user need to login first before they can be promoted.

    CMIIW.
     
    Donnie La Curan likes this.
  12. Donnie La Curan

    Donnie La Curan Active Member

Share This Page