Данным скриптом можно удалить права у персоны All_users, не затронув права персон находящиеся в его иерархическом древе.
declare AllUsersID number; begin select ID into AllUsersID from t_users where username='All users'; delete from t_user_rights where userid=AllUsersID; delete from USER_ACCTYPE_POLICY where userid=AllUsersID; delete from nostro_users where userid=AllUsersID; update BOOKS_USERS set right_=-1 where userid=AllUsersID; update T_STADY_RIGHTS set bottom='False', TOP_RIGHTS='False' where userid=AllUsersID; delete from LIMIT.bt_dictionariesrights where id_object=AllUsersID; delete from customer_group_rights where user_id=AllUsersID; delete from LIMIT.BT_USERLIMITNOTIFICATIONS where id_user=AllUsersID; UPDATE RESMAN.T_USERS SET MANUAL_AUTHOR_FILTER = '' ,IS_USE_AUTHOR_FILTER = 0 ,IS_CHECK_QUOTES = 0 ,QUOTE_AMOUNT = 0 ,ID_QUOTE_CCY = null ,DAYS_FOR_NOTIFY_MASK = 0 WHERE ID = AllUsersID; delete from LIMIT.bt_userlimitdonors where id_user=AllUsersID; delete from LIMIT.bt_user_message_type where id_user=AllUsersID; LOGGER.LOG_INFORMATION_T(TP_LOGGER_HEAD('UPDATEVERSION_SCRIPTS'),'NAV-7496 отобрать все права у пользователя All_Users'); end;