Wrote setPermissions method