mirror of
https://github.com/abhinavxd/libredesk.git
synced 2025-11-03 13:33:32 +00:00
feat: manage contacts
- New permission `contacts:manage` - Views for contact list and single contact view. - Ability to block contacts that in inturn stops new messages from the contact. - Make all DB transactions that run dynamically generated SQL query `readonly` - Rename `/admin/teams/users` to `/admin/users/agents/` for consistency. (ref #50) - Fix UI glitches for long emails (refs #54) - Fix empty created_at date for agents admin table (refs #51) - Migrations for v0.6.0
This commit is contained in:
@@ -64,5 +64,16 @@ func V0_6_0(db *sqlx.DB, fs stuffbin.FileSystem, ko *koanf.Koanf) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Add `contacts:manage` permission to Admin role
|
||||
_, err = db.Exec(`
|
||||
UPDATE roles
|
||||
SET permissions = array_append(permissions, 'contacts:manage')
|
||||
WHERE name = 'Admin' AND NOT ('contacts:manage' = ANY(permissions));
|
||||
`)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user