Pol Monroig Posted December 10, 2022 Report Share Posted December 10, 2022 I would like to know how can I query the access to each project using the ftrack api. What I mean by access is this https://help.ftrack.com/en/articles/3601282-managing-project-access ,not the roles but the access to each specific project by user. I am using the javascript api but I think python would be the same, the problem is creating the specific query. I appreciate the help! Thanks Link to comment Share on other sites More sharing options...
Erik LaPlant Posted January 11, 2023 Report Share Posted January 11, 2023 You could try: >>> p = session.query('Project where id is "<INSERT PROJECT ID>"').one() >>> for role in p['user_security_role_projects']: ... print(role['project']['name'], role['user_security_role']['user']['username'], role['user_security_role']['security_role']['name']) Link to comment Share on other sites More sharing options...
Pol Monroig Posted January 12, 2023 Author Report Share Posted January 12, 2023 Hello, thanks for your reply, that seems to work in Python although in javascript I do get an error when running the query. I only get the error when asking for the user attribute, without it it does return me a list of security roles but just with Ids session.query('select name,user_security_role_projects.user from Project'); "No attribute u'user' exists for schema u'UserSecurityRoleProject'." Link to comment Share on other sites More sharing options...
Patrick Boucher ftrack Posted January 12, 2023 Report Share Posted January 12, 2023 Hi Pol, Off the cuff, it looks like you're missing `user_security_role` in that projection chain. Could you try: select name, user_security_role_projects.user_security_role.user from Project Regards, Patrick Link to comment Share on other sites More sharing options...
Pol Monroig Posted January 15, 2023 Author Report Share Posted January 15, 2023 Hey Patrick, Thanks you are right!! I got confused by the two types of user_security_roles haha it works now Patrick Boucher ftrack 1 Link to comment Share on other sites More sharing options...
Patrick Boucher ftrack Posted January 16, 2023 Report Share Posted January 16, 2023 Awesome, Pol. I'm happy you've got things running and thanks for letting us know. Have a great week! Patrick Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now