mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
action discover by roles
This commit is contained in:
parent
9ce271ae19
commit
75bfcb0f40
1 changed files with 9 additions and 3 deletions
|
|
@ -61,16 +61,22 @@ class PushHierValuesToNonHier(ServerAction):
|
|||
# configurable
|
||||
interest_entity_types = ["Shot"]
|
||||
interest_attributes = ["frameStart", "frameEnd"]
|
||||
role_list = ["Pypeclub", "Administrator", "Project Manager"]
|
||||
|
||||
settings_key = "sync_hier_entity_attributes"
|
||||
|
||||
def discover(self, session, entities, event):
|
||||
""" Validation """
|
||||
# Check if selection is valid
|
||||
is_valid = False
|
||||
for ent in event["data"]["selection"]:
|
||||
# Ignore entities that are not tasks or projects
|
||||
if ent["entityType"].lower() in ("task", "show"):
|
||||
return True
|
||||
return False
|
||||
is_valid = True
|
||||
break
|
||||
|
||||
if is_valid:
|
||||
is_valid = self.valid_roles(session, entities, event)
|
||||
return is_valid
|
||||
|
||||
def launch(self, session, entities, event):
|
||||
self.log.debug("{}: Creating job".format(self.label))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue