added remove function for permissions.

This commit is contained in:
5elenay 2021-08-26 17:07:08 +03:00
parent f11411a988
commit 19d371e8ea

View File

@ -74,6 +74,17 @@ func (p *Permissions) Add(perms ...string) *Permissions {
return p return p
} }
// Remove permission(s).
func (p *Permissions) Remove(perms ...string) *Permissions {
for _, perm := range perms {
if value, ok := p.Permissions[perm]; ok {
p.Bitvise = p.Bitvise - value
}
}
return p
}
// Calculate perms and return unsigned int. // Calculate perms and return unsigned int.
func (p Permissions) Calculate(perms ...string) uint { func (p Permissions) Calculate(perms ...string) uint {
var total uint var total uint