I am very new to Alpha Five products and I am trying to figure out the row level data security. In other words I have a grid with the user information from diferent countries. I want to filter the grid based upon the user login from each country. I am using the session variable as country and i added these lines of code in the index page.
<?xml version="1.0" encoding="utf-8"?>
<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">
'<%a5
'dim session.country as c = ""
'%>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" >
<head>
<%a5
'The componentAlias MUST be UNIQUE for each component on the page. It must not have spaces in the name. Keep name as short as possible
dim componentAlias as c
componentAlias = "LOGIN"
Delete tmpl_LOGIN
DIM tmpl_LOGIN as P
tmpl_LOGIN = a5w_load_component("Login") 'SYSTEM GENERATED COMMENT - PLEASE DO NOT REMOVE (LOAD:Login)
'Following code allows you to override settings in the saved component, and specify the component alias (componentName property).
'Tip: Keep the componentName property short because this name is used in page URLs, and it will help keep the URLs short.
'Each component on a page must have a unique alias (componentName property).
with tmpl_LOGIN
componentName = "LOGIN"
end with
'=======================================compute the HTML for the Component=======================================
delete x_LOGIN
dim x_LOGIN as p
x_LOGIN = a5w_run_Component(tmpl_LOGIN) 'SYSTEM GENERATED COMMENT - PLEASE DO NOT REMOVE (RUN:tmpl_LOGIN) (EDIT:Login)
'=============================================================================================================
if x_LOGIN.RedirectURL <> "" then
'dim country as c
'country = a5ws_getcurrentuser()()
'if country <>""
'dim args as sql::Arguments
'args.Set("country",country)
'session.country = sql_lookup("::name::CSCBase","COMP_SRMGRS","WorkCountry = :country","country",args)
'end if
response.redirect(x_LOGIN.redirectURL)
end
end if
But still it is not working. I also need help in the sql_lookup syntax which I am not sure whether I am using it right. It will be greatly appreciated if anyone can help me in this issue. Any alternative solutions are also welcome.
Thanks!
<?xml version="1.0" encoding="utf-8"?>
<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd">
'<%a5
'dim session.country as c = ""
'%>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" >
<head>
<%a5
'The componentAlias MUST be UNIQUE for each component on the page. It must not have spaces in the name. Keep name as short as possible
dim componentAlias as c
componentAlias = "LOGIN"
Delete tmpl_LOGIN
DIM tmpl_LOGIN as P
tmpl_LOGIN = a5w_load_component("Login") 'SYSTEM GENERATED COMMENT - PLEASE DO NOT REMOVE (LOAD:Login)
'Following code allows you to override settings in the saved component, and specify the component alias (componentName property).
'Tip: Keep the componentName property short because this name is used in page URLs, and it will help keep the URLs short.
'Each component on a page must have a unique alias (componentName property).
with tmpl_LOGIN
componentName = "LOGIN"
end with
'=======================================compute the HTML for the Component=======================================
delete x_LOGIN
dim x_LOGIN as p
x_LOGIN = a5w_run_Component(tmpl_LOGIN) 'SYSTEM GENERATED COMMENT - PLEASE DO NOT REMOVE (RUN:tmpl_LOGIN) (EDIT:Login)
'=============================================================================================================
if x_LOGIN.RedirectURL <> "" then
'dim country as c
'country = a5ws_getcurrentuser()()
'if country <>""
'dim args as sql::Arguments
'args.Set("country",country)
'session.country = sql_lookup("::name::CSCBase","COMP_SRMGRS","WorkCountry = :country","country",args)
'end if
response.redirect(x_LOGIN.redirectURL)
end
end if
But still it is not working. I also need help in the sql_lookup syntax which I am not sure whether I am using it right. It will be greatly appreciated if anyone can help me in this issue. Any alternative solutions are also welcome.
Thanks!
Comment