Last active
May 19, 2016 14:27
-
-
Save MariuszWisniewski/e5dee79a2a85b92eea25b54051344a7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import syncano | |
from syncano.models import User | |
from syncano.models import Object | |
syncano.connect(api_key='ACCOUNT_KEY', instance_name=META['instance']) | |
user_id = ARGS['owner'] | |
user_profile_id = ARGS['id'] | |
user = User.please.get( | |
id=user_id | |
) | |
print "Adding username and read permissions for user {user}".format(user=user.username) | |
Object.please.update( | |
id=user_profile_id, | |
class_name='user_profile', | |
other_permissions='read', | |
username=user.username #optional - for this to work, user_profile must have a `username` of type String column | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment