{"action":"created","issue":{"url":"https://api.github.com/repos/volkanceylan/Serenity/issues/434","repository_url":"https://api.github.com/repos/volkanceylan/Serenity","labels_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/434/labels{/name}","comments_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/434/comments","events_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/434/events","html_url":"https://github.com/volkanceylan/Serenity/issues/434","id":142075319,"number":434,"title":"Creating a simple profile.","user":{"login":"wdhodges","id":11448029,"avatar_url":"https://avatars.githubusercontent.com/u/11448029?v=3","gravatar_id":"","url":"https://api.github.com/users/wdhodges","html_url":"https://github.com/wdhodges","followers_url":"https://api.github.com/users/wdhodges/followers","following_url":"https://api.github.com/users/wdhodges/following{/other_user}","gists_url":"https://api.github.com/users/wdhodges/gists{/gist_id}","starred_url":"https://api.github.com/users/wdhodges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wdhodges/subscriptions","organizations_url":"https://api.github.com/users/wdhodges/orgs","repos_url":"https://api.github.com/users/wdhodges/repos","events_url":"https://api.github.com/users/wdhodges/events{/privacy}","received_events_url":"https://api.github.com/users/wdhodges/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-03-19T15:46:53Z","updated_at":"2016-03-23T01:52:44Z","closed_at":null,"body":"So I would like to link my users table to a table named employee, I'm not fully sure how to do this and was wondering if anyone had some incite about a possible solution. Also, is there a way that I can set it to where the current logged in 'employee' can only see and edit their profile and not see others profile unless they are an admin?\r\n\r\nSorry for yet another question."},"comment":{"url":"https://api.github.com/repos/volkanceylan/Serenity/issues/comments/200122444","html_url":"https://github.com/volkanceylan/Serenity/issues/434#issuecomment-200122444","issue_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/434","id":200122444,"user":{"login":"jsbUSMC","id":11762092,"avatar_url":"https://avatars.githubusercontent.com/u/11762092?v=3","gravatar_id":"","url":"https://api.github.com/users/jsbUSMC","html_url":"https://github.com/jsbUSMC","followers_url":"https://api.github.com/users/jsbUSMC/followers","following_url":"https://api.github.com/users/jsbUSMC/following{/other_user}","gists_url":"https://api.github.com/users/jsbUSMC/gists{/gist_id}","starred_url":"https://api.github.com/users/jsbUSMC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsbUSMC/subscriptions","organizations_url":"https://api.github.com/users/jsbUSMC/orgs","repos_url":"https://api.github.com/users/jsbUSMC/repos","events_url":"https://api.github.com/users/jsbUSMC/events{/privacy}","received_events_url":"https://api.github.com/users/jsbUSMC/received_events","type":"User","site_admin":false},"created_at":"2016-03-23T01:52:44Z","updated_at":"2016-03-23T01:52:44Z","body":"To expand upon @volkanceylan response, I found that when I implemented some code to pull the currently logged in user's UserId, I had to do this:\r\n\r\n```cs\r\n// Example code implemented in EntityRepository.cs\r\nprivate class MySaveHandler : SaveRequestHandler<MyRow>\r\n{\r\n    protected override void SetInternalFields()\r\n    {\r\n        base.SetInternalFields();\r\n\r\n        if (IsCreate)\r\n            Row.Analyst = ((UserDefinition) Authorization.UserDefinition).UserId;\r\n    }\r\n} \r\n```\r\n\r\nVisual Studio barfed when I tried to assign `Row.Analyst = Authorization.UserId;`, I ended up having to cast the Authorization.UserDefinition as a UserDefinition object, and call the UserId property from that object. I think the specific error was that `VS can't assign an object of type 'int' to property of type 'stringfield'`. I may be wrong about the specific error, but this was the workaround that worked. "}}