mirror of
https://github.com/passbolt/go-passbolt.git
synced 2025-05-09 17:48:20 +00:00
fix spelling in comment
This commit is contained in:
parent
d59d0cc0e5
commit
9ef897d7a1
2 changed files with 4 additions and 4 deletions
|
@ -158,7 +158,7 @@ func (c *Client) Login(ctx context.Context) error {
|
||||||
return fmt.Errorf("Decrypted PublicKey Validation Message does not Match Original (you might be getting Hacked): %w", err)
|
return fmt.Errorf("Decrypted PublicKey Validation Message does not Match Original (you might be getting Hacked): %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert PublicKey into Client after checking it to Prevent ignored errors leading to proceding with a potentially Malicious PublicKey
|
// Insert PublicKey into Client after checking it to Prevent ignored errors leading to proceeding with a potentially Malicious PublicKey
|
||||||
c.userPublicKey = user.GPGKey.ArmoredKey
|
c.userPublicKey = user.GPGKey.ArmoredKey
|
||||||
c.userID = user.ID
|
c.userID = user.ID
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ func ShareResource(ctx context.Context, c *api.Client, resourceID string, change
|
||||||
|
|
||||||
// ShareFolderWithUsersAndGroups Shares a Folder With The Users and Groups with the Specified Type,
|
// ShareFolderWithUsersAndGroups Shares a Folder With The Users and Groups with the Specified Type,
|
||||||
// if the Folder has already been shared With the User/Group the Permission Type will be Adjusted/Deleted.
|
// if the Folder has already been shared With the User/Group the Permission Type will be Adjusted/Deleted.
|
||||||
// Note: Resources Permissions in the Folder are not Adjusted (Like the Extention does)
|
// Note: Resources Permissions in the Folder are not Adjusted (Like the Extension does)
|
||||||
func ShareFolderWithUsersAndGroups(ctx context.Context, c *api.Client, folderID string, Users []string, Groups []string, permissionType int) error {
|
func ShareFolderWithUsersAndGroups(ctx context.Context, c *api.Client, folderID string, Users []string, Groups []string, permissionType int) error {
|
||||||
changes := []ShareOperation{}
|
changes := []ShareOperation{}
|
||||||
for _, userID := range Users {
|
for _, userID := range Users {
|
||||||
|
@ -159,14 +159,14 @@ func GeneratePermissionChanges(oldPermissions []api.Permission, changes []ShareO
|
||||||
|
|
||||||
permissionChanges := []api.Permission{}
|
permissionChanges := []api.Permission{}
|
||||||
for _, change := range changes {
|
for _, change := range changes {
|
||||||
// Find Permission thats invloves the Same ARO as Requested in the change
|
// Find Permission thats involves the Same ARO as Requested in the change
|
||||||
var oldPermission *api.Permission
|
var oldPermission *api.Permission
|
||||||
for _, oldPerm := range oldPermissions {
|
for _, oldPerm := range oldPermissions {
|
||||||
if oldPerm.ARO == change.ARO && oldPerm.AROForeignKey == change.AROID {
|
if oldPerm.ARO == change.ARO && oldPerm.AROForeignKey == change.AROID {
|
||||||
oldPermission = &oldPerm
|
oldPermission = &oldPerm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Check Wheter Matching Permission Already Exists and needs to be adjusted or is a new one can be created
|
// Check Whether Matching Permission Already Exists and needs to be adjusted or is a new one can be created
|
||||||
if oldPermission == nil {
|
if oldPermission == nil {
|
||||||
if change.Type == 15 || change.Type == 7 || change.Type == 1 {
|
if change.Type == 15 || change.Type == 7 || change.Type == 1 {
|
||||||
permissionChanges = append(permissionChanges, api.Permission{
|
permissionChanges = append(permissionChanges, api.Permission{
|
||||||
|
|
Loading…
Add table
Reference in a new issue