예제 #1
0
def add_group_type_access(context, group_type_id, project_id):
    """Add access to group type for project_id."""
    if group_type_id is None:
        msg = _("group_type_id cannot be None")
        raise exception.InvalidGroupType(reason=msg)
    elevated = context if context.is_admin else context.elevated()
    if is_public_group_type(elevated, group_type_id):
        msg = _("Type access modification is not applicable to public group " "type.")
        raise exception.InvalidGroupType(reason=msg)
    return db.group_type_access_add(elevated, group_type_id, project_id)
예제 #2
0
def add_group_type_access(context, group_type_id, project_id):
    """Add access to group type for project_id."""
    if group_type_id is None:
        msg = _("group_type_id cannot be None")
        raise exception.InvalidGroupType(reason=msg)
    elevated = context if context.is_admin else context.elevated()
    if is_public_group_type(elevated, group_type_id):
        msg = _("Type access modification is not applicable to public group "
                "type.")
        raise exception.InvalidGroupType(reason=msg)
    return db.group_type_access_add(elevated, group_type_id, project_id)