Example #1
0
 def to_dto(self):
     permission = Permission(
         self.applicable_permission_type.permission_type[0].name
     )
     for param in self.parameters:
         permission.add_parameter(param.to_dto())
     return permission
def _generate_permissions():
    p1 = Permission("experiment_allowed")
    p1.add_parameter(PermissionParameter("experiment_name", "string", "ud-fpga"))
    p1.add_parameter(PermissionParameter("experiment_category", "string", "FPGA experiments"))
    p1.add_parameter(PermissionParameter("time_allowed", "float", "300"))
    p2 = Permission("admin_panel_access")
    p2.add_parameter(PermissionParameter("full_privileges", "bool", "300"))
    return p1, p2
Example #3
0
 def to_dto(self):
     permission = Permission( self.permission_type )
     for param in self.parameters:
         permission.add_parameter(param.to_dto())
     return permission
def _generate_permissions():
    p1 = Permission("experiment_allowed")
    p1.add_parameter(
        PermissionParameter("experiment_name", "string", "ud-fpga"))
    p1.add_parameter(
        PermissionParameter("experiment_category", "string",
                            "FPGA experiments"))
    p1.add_parameter(PermissionParameter("time_allowed", "float", "300"))
    p2 = Permission("admin_panel_access")
    p2.add_parameter(PermissionParameter("full_privileges", "bool", "300"))
    return p1, p2