Alpha Developers Network

Guest


Author Topic: Security functions  (Read 1101 times)

0 Members and 1 Guest are viewing this topic.

catalin

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
  • Real Name: Catalin Lungu
Security functions
« on: September 26, 2013, 11:19:30 PM »
Hi Steve,
I have worked with parts of your framework to make my web. I have implemented the user registration and now (after the user have been registrated) I need to change him from the default group "Users" to another from the users administration page. I have a function it's seems like working but is not true.

FUNCTION ChangeUserGroup AS L (userId AS C, newGroup AS C)
dim uservalue.groups as c
dim uservalue.guid as c
dim output as p
dim output.controls as p
dim output.controls.guid.value as c
dim result as p
dim error_message as c

dim uservalue.userid as c
dim uservalue.email as c
dim request as p

debug(1)
uservalue.guid = A5WS_Get_GUID_From_User(userId, request)
uservalue.groups = newGroup
uservalue.userid = userId
uservalue.email = userId

result = a5ws_Save_WebUser_Values(output,uservalue)
if result.errors = .T. then
error_message = result.error_text
LogA5(error_message)
ChangeUserGroup = .f.
end
end if
ChangeUserGroup = .t.
END FUNCTION


Also I want to know what is the right way to define permission to a web or actions in this page?
Now I have a table with the pages and the actions (delete row, update row, etc.) and I need an administrator defines the permisions for every user group from the web interface. It's necesary to check on page initialize if the user has permission or is there any function that inform to A5 if the user have or not permission, something like set_user_permision(page, "Y/N")

I hope you understand me, my english is a little lacking.

Thank you,
Catalin

Steve Wood

  • Administrator
  • Expert
  • *****
  • Posts: 704
  • Karma: +11/-0
    • AlphaToGo
  • Real Name: Steve Wood
Re: Security functions
« Reply #1 on: September 27, 2013, 01:19:50 AM »
I will try the function on my copy.

For your other question, do you mean you want to set permissions for access to A5W pages for different users, and do this online? We could figure out a way, but it would not be using Alpha Five's built in security. That has to be managed at the Project level and then published up to the server.
---
Steve Wood
www.alphatogo.com

catalin

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
  • Real Name: Catalin Lungu
Re: Security functions
« Reply #2 on: September 27, 2013, 05:21:45 AM »
Yes I want to set user permission to access A5 page. I suppose when you set permissions to a page from A5 inteface (Web security->Component security-> right click on page), you are using a function. It is available this function? I would like to use the embbeded security of A5. If it is not available I will check the permission on every page.

Thanks.

Steve Wood

  • Administrator
  • Expert
  • *****
  • Posts: 704
  • Karma: +11/-0
    • AlphaToGo
  • Real Name: Steve Wood
Re: Security functions
« Reply #3 on: September 27, 2013, 07:38:29 AM »
Unfortunately it is not a function. It is a simple text file named pages.securitysettings and it is cached in memory when the server starts. You could write to that file from a live system, but every time you publish anything from the Developer, it will get overwritten.
---
Steve Wood
www.alphatogo.com

Peter Greulich

  • Expert
  • ***
  • Posts: 258
  • Karma: +2/-0
    • http://www.alphabasesolutions.com/
Re: Security functions
« Reply #4 on: September 27, 2013, 09:49:19 AM »
You can set CRUD level security using groups in components.
Peter
AlphaBase Solutions, LLC
www.alphabasesolutions.com

catalin

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
  • Real Name: Catalin Lungu
Re: Security functions
« Reply #5 on: September 30, 2013, 01:36:55 AM »
Hi Peter,
I know what's CRUD means but I don't know what should I do to make the security. Can you give me more details?


Hi Steve,
Do you know why I can't change user gorup for an user? (first questions)


Thanks,
Catalin

Peter Greulich

  • Expert
  • ***
  • Posts: 258
  • Karma: +2/-0
    • http://www.alphabasesolutions.com/
Re: Security functions
« Reply #6 on: October 01, 2013, 02:08:45 PM »
Grids & dialogs have security settings in various places. Typically labeled "security". Search around in properties for both fields and the component itself. In those places you can assign one or more groups to view edit add delete.
Peter
AlphaBase Solutions, LLC
www.alphabasesolutions.com

catalin

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
  • Real Name: Catalin Lungu
Re: Security functions
« Reply #7 on: July 31, 2014, 08:36:08 AM »
Hi Steve,
For a5w and a5wcmp I use pages.SecuritySettings but what should I do for menus and other ux components?