Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ALTER PROCEDURE [dbo].[as_pg_getMenuPages]
- @username nvarchar(128),
- @onlyStartPanel bit,
- @langID int = 0
- AS
- BEGIN
- declare @roles table(role nvarchar(128))
- insert into @roles
- select role from dbo.sec_getuserRoles(@username)
- select pg_pages.id,
- isnull(as_lang_pages.title, pg_pages.title) title,
- menuPreTitle,
- isnull(as_lang_pages.description, pg_pages.description) description,
- pg_pages.code,
- pg_pages.isInMenu,
- pg_pages.ord,
- pg_pages.menuIcon,
- pg_pages.parentID,
- pg_pages.isStartPanel
- from pg_pages left join as_lang_pages on as_lang_pages.itemID = pg_pages.id and langID = @langID
- where
- [role]<>'all' and @username <>'' and
- (
- isinMenu='1' and exists(select value from dbo.split([role], ',') where value in (select role from @roles))
- and (@onlyStartpanel='0' or @onlyStartpanel='1' and isStartPanel='1' )
- )
- or ( [role]='all' and isinMenu='1' and @username='')
- or ( [role]='*' and isinMenu='1' and (select count(*) from @roles)>0)
- order by ord
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement