Advertisement
Ruslan_Rayanov

Check rights in Company

Nov 15th, 2024
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.94 KB | None | 0 0
  1.     "        
  2. ПРОВЕРКИ ДОСТУПА В МОДУЛЯХ - ПРИМЕРЫ
  3. "
  4. Таблица Getitems "if(dbo.cm_hasRight(@username, 'crm','seller')=0) begin
  5.        select 1 where 1=0
  6.        select 0
  7.        select 'Нет доступа' EmptyText
  8.        return
  9. end "
  10. Таблица или форма некое действие    "if(dbo.cm_hasRight(@username, 'crm','seller')=0) begin            
  11.        select 0 Result, 'Нет доступа' Msg
  12.        return
  13. end "
  14. Форма GetItem  "if(dbo.cm_hasRight(@username, 'crm','seller')=0) begin            
  15.        select 1
  16.        select '{""title"": ""Нет доступа"", ""type"": ""dagner"" }' NoForm
  17.        return
  18. end "
  19. Страница    "declare @username nvarchar(max) = (select value from @urlParameters where [key]='username')
  20. if(dbo.cm_hasRight(@username, 'crm','seller')=0) begin
  21.            select 1
  22.        select '/' RedirectUrl
  23.        return
  24. end "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement