User not owning his folder in Blackboard
So, here is the deal, if for some reason you have created a bunch of users, you will almost immediately notice that they will have their own folder in the content system, usually by following the path: /users/<username> but if the user gets deleted, that folder will be changed the owner to system or something else, but then if the user gets recreated again, the same folder will still be own by system, so that is not good.
so here is the use case:
- user: userA gets created in the system
- folder: /users/userA gets created in the system and own with full read permissions for userA
- user: userA gets deleted from the system
- folder: /user/userA does not get deleted but gets changed the owner to system
- this is to prevent that the content is lost because of a user deletion
- user: userA gets recreated in the system
- folder: /user/userA does not get created because it already exists but it does not change the owner from system to userA
- When userA wants to access the system and his folder or his content, he will be getting a permissions issue and will not have access to his folder.
To correct this use case, you will need to understand the query. Also you will need to uncomment the only line that is comment.
note: RUN IT AT YOUR OWN RISK - we are not troubleshooting but documenting this information.
Please beware, like the above note stated, we are not supporting or making any changes, nor giving you the path to solve an issue, this is for documentation purposes and you should use it at your own risk.
The query without the update statement will print out a list of users who don’t own their folders. this is good to have it as knowledge and see how it works.
This query touches a lot of moving parts and if not tested before and back up (without removing the commented line) you will have something that might not be working, so its always a good idea, to back up and have some where to go as a restore point which usually databases don’t give you.
With great power comes great responsability
This documentation with nice coding can be looked at: https://gist.github.com/enriquemanuel/6452127