- 
                Notifications
    You must be signed in to change notification settings 
- Fork 554
feat: oss ent refactoring #6414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: oss ent refactoring #6414
Conversation
        
          
                pkg/auth/user/RoleGroupService.go
              
                Outdated
          
        
      | clusterRoleFieldDto := adapter.BuildClusterRoleFieldsDto(entity, accessType, roleFilter.Cluster, namespace, group, kind, resource, actionType, subaction) | ||
| roleModel, err := impl.userAuthRepository.GetRoleByFilterForAllTypes(clusterRoleFieldDto) | ||
| if err != nil { | ||
| impl.logger.Errorw("error in getting new role model by filter") | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add context+ error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
        
          
                pkg/auth/user/UserCommonService.go
              
                Outdated
          
        
      | if roleModel.Id == 0 { | ||
| impl.logger.Warnw("no role found for given filter", "filter", roleFilter) | ||
| impl.logger.Debugw("no role found for given filter", "filter", roleFilter) | ||
| userInfo.Status = "role not fount for any given filter: " + roleFilter.Team + "," + environment + "," + entityName + "," + roleFilter.Action | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if we can remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| } | ||
| if !operationDone { | ||
| //loading policy for safety | ||
| casbin2.LoadPolicy() | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if user specific reload is possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not present
        
          
                pkg/auth/user/UserService.go
              
                Outdated
          
        
      | UpdatedOn: time.Now(), | ||
| }} | ||
| userRoleModel, err = impl.userAuthRepository.CreateUserRoleMapping(userRoleModel, tx) | ||
| impl.logger.Infow("Creating Polices for cluster", resource, kind, namespace, group) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use key val pair
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| switch entity { | ||
| case bean2.CLUSTER_ENTITIY: | ||
| { | ||
| cluster, namespace, group, kind, resource, action := roleFieldDto.Cluster, roleFieldDto.Namespace, roleFieldDto.Group, roleFieldDto.Kind, roleFieldDto.Resource, roleFieldDto.Action | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flat common keys at top
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| 
 | 


Description
Fixes #
Checklist:
Does this PR introduce a user-facing change?