- 
                Notifications
    
You must be signed in to change notification settings  - Fork 630
 
feat: AddUserRole api #423
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
          
     Merged
      
      
    
                
     Merged
            
            
          Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    
      
        
      
      
  
    6 tasks
  
| 
           Moving this back to in progress since the "run test" check is not passing..  | 
    
| 
           Write down all test cases you have covered in the PR message above. Moving this back to in progress  | 
    
              
                    rishabhpoddar
  
              
              suggested changes
              
                  
                    Apr 16, 2022 
                  
              
              
            
            
              
                    rishabhpoddar
  
              
              approved these changes
              
                  
                    Apr 18, 2022 
                  
              
              
            
            
    
  rishabhpoddar 
      added a commit
      that referenced
      this pull request
    
      May 6, 2022 
    
    
      
  
    
      
    
  
* adds addUserRoleAPI * renames functions for retriving tables * fixs * fixs, adds create index queries and create table queries to start file * fixs * fixs index name for role_permissions table * feedback fixs * test(userroles): Add create role api (#418) * adds createRole API * fixs * adds more bad input tests * adds more tests * implements some feedback * adds lock to doesRoleExist_Transaction * adds some storage tests * removes print statement * adds some storage tests * adds more tests * fixs * test fixs * adds missing commitTransaction * updates test * fixs incorrect foreign key constraint names * fixs * userRole updates due to plugin-interface changes, Updates queries and tests * adds getRoles test * updates createNewRole query name * test fixs * renames addPermissionToRole function (#425) * feat: AddUserRole api (#423) * fixs * fixs * test, fixs * adds more storage tests for addRoleToUser * adds tests for addRoleToUser core function * fixs sanitizing role in api * adds badInputTests * adds additional tests * adds addtional storagetest to check UNKNOWN_ROLE_EXCEPTION * test fixs * fix: updates plugin-interface functions, test fixs (#428) * fix: updates plugin-interface functions, test fixs * adds remaining changes * fixs * updates function name * test fixs * changes didUserHaveRole to didUserAlreadyHaveRole * feat: adds RemoveUserRoleAPI (#426) * initial commit * query fixs, adds storage tests * adds userRoles tests * adds removeUserRoleAPI * adds removeUserRoleAPI * updates RemoveUserRole api and function to now return a boolean on whether the user had the role * adds serialVersion field for API * adds test to check removing a role from a user, where the user did not have the role * adds more core tests * fixs * adds FOR UPDATE to doesRoleExist_Transaction * udpates to test * fixs * feedback fisx * feat: get userroles api (#430) * initial commit * query fixs, adds storage tests * adds userRoles tests * adds removeUserRoleAPI * adds removeUserRoleAPI * updates RemoveUserRole api and function to now return a boolean on whether the user had the role * adds serialVersion field for API * adds test to check removing a role from a user, where the user did not have the role * adds more core tests * fixs * adds FOR UPDATE to doesRoleExist_Transaction * udpates to test * fixs * fixs * test fixs * fixs * adds more core tests * adds more core tests * feedback fixs * feat: adds GetUsersForRoleAPI + tests (#431) * initial commit * query fixs, adds storage tests * adds userRoles tests * adds removeUserRoleAPI * adds removeUserRoleAPI * updates RemoveUserRole api and function to now return a boolean on whether the user had the role * adds serialVersion field for API * adds test to check removing a role from a user, where the user did not have the role * adds more core tests * fixs * adds FOR UPDATE to doesRoleExist_Transaction * udpates to test * fixs * fixs * test fixs * adds test and query fix * adds remaining storage test * adds core function test * temp commit * fixs * test fixs * test fixs * typo fix * feat: adds GetPermissionsForRoleAPI + tests * Revert "feat: adds GetPermissionsForRoleAPI + tests" This reverts commit cb89fff. * feedback fixs * feat: adds GetPermissionForRoleAPI + tests (#432) * initial commit * query fixs, adds storage tests * adds userRoles tests * adds removeUserRoleAPI * adds removeUserRoleAPI * updates RemoveUserRole api and function to now return a boolean on whether the user had the role * adds serialVersion field for API * adds test to check removing a role from a user, where the user did not have the role * adds more core tests * fixs * adds FOR UPDATE to doesRoleExist_Transaction * udpates to test * fixs * fixs * test fixs * adds test and query fix * adds remaining storage test * adds core function test * temp commit * fixs * test fixs * test fixs * typo fix * feat: adds GetPermissionsForRoleAPI + tests * fixs * removes unnecessary print statments * adds tests and some fixs * feat: adds RemovePermissionsFromRoleAPI + tests (#433) * adds core function * adds RemovePermissionsForRoleAPI * adds basic storage tests * adds core function tests * fixs * removes unused imports * fixs * adds an additional api test * adds missing transaction commit * implements feedback * feat: adds GetRolesForPermissionAPI + tests (#434) * adds core function * adds RemovePermissionsForRoleAPI * adds basic storage tests * adds core function tests * fixs * removes unused imports * fixs * adds an additional api test * adds getRolesForPermissionAPI * adds storage test * adds core function tests * adds API tests * adds missing transaction commit * implements feedback * feat: adds RemoveRoleAPI + tests (#436) * adds core function * adds RemovePermissionsForRoleAPI * adds basic storage tests * adds core function tests * fixs * removes unused imports * fixs * adds an additional api test * adds getRolesForPermissionAPI * adds storage test * adds core function tests * adds API tests * adds missing transaction commit * implements feedback * feat: Adds RemoveRoleAPI * fixs + adds storage test * adds api test * adds core tests * adds remaining API tests * removes unused import * implements feedback * feat: adds GetRolesAPI + tests (#437) * adds core function * adds RemovePermissionsForRoleAPI * adds basic storage tests * adds core function tests * fixs * removes unused imports * fixs * adds an additional api test * adds getRolesForPermissionAPI * adds storage test * adds core function tests * adds API tests * adds missing transaction commit * implements feedback * feat: Adds RemoveRoleAPI * fixs + adds storage test * adds api test * adds core tests * adds remaining API tests * removes unused import * fixs * implements feedback * Adds test * adds additional tests * feat: adds deleteAllRolesForUser + tests (#438) * adds core function * adds RemovePermissionsForRoleAPI * adds basic storage tests * adds core function tests * fixs * removes unused imports * fixs * adds an additional api test * adds getRolesForPermissionAPI * adds storage test * adds core function tests * adds API tests * adds missing transaction commit * implements feedback * feat: Adds RemoveRoleAPI * fixs + adds storage test * adds api test * adds core tests * adds remaining API tests * removes unused import * fixs * implements feedback * Adds test * adds additional tests * adds core function for removing all roles for a user * adds storage test * adds core function tests * adds deleteAllRolesForUser to deleteUser function * adds additional test * chore: remaining checklist todos (#439) * updates build.gradle and CHANGELOG * updates * feedback fixs * test: updates test (#440) * updates CHANGELOG.md Co-authored-by: Rishabh Poddar <rishabh.poddar@gmail.com>
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Summary of change
Refactors AddUserRole API in the
user-rolesbase branch + fixs. Adds tests for AddUserRole API related functions.Related issues
Test Plan
API tests:
UNKNOWN_ROLE_EXCEPTION, check that user does not have a roleCore functions test
Storage tests
DuplicateRoleExceptionand the user should not have duplicate rolesDocumentation changes
(If relevant, please create a PR in our docs repo, or create a checklist here highlighting the necessary changes)
Checklist for important updates
[ ] Changelog has been updated[ ] If there are any DB schema changes, mention those changes clearly[ ]coreDriverInterfaceSupported.jsonfile has been updated (if needed)[ ]pluginInterfaceSupported.jsonfile has been updated (if needed)[ ] Changes to the version if neededInbuild.gradle[ ] If there are new dependencies that have been added inbuild.gradle, please make sure to add them inimplementationDependencies.json.git tag) in the formatvX.Y.Z, and then find the latest branch (git branch --all) whoseX.Yis greater than the latest released tag.Remaining TODOs for this PR