public static void CreateItemAccessValidation(this AppUserRole userRole, Item item, string userId) { //Check if user is master or owner -> he can create everything. if (userRole.IsScrumMasterOrOwner()) { return; } // Check if Developer can create item if (userRole.CanCreateItem(item, userId)) { return; } throw new ForbiddenResponseException("You dont have access to create items!"); }