I'm mainly a front-end devloper, so the basic server-side aspect of the project I'm working on is escaping me.
我主要是一个前端devloper,所以我正在研究的项目的基本服务器端方面是逃避我。
My main webpage has a list of products pulled from a JSON array with angularjs' ng-repeat, but I'd like to add an administrative page in which authenticated users could push a JSON object to the array. How can I do this with no experience in any server-side scripting languages?
我的主网页有一个从带有angularjs'ng-repeat的JSON数组中提取的产品列表,但是我想添加一个管理页面,其中经过身份验证的用户可以将JSON对象推送到该数组。如何在没有任何服务器端脚本语言经验的情况下完成此操作?
1 个解决方案
#1
0
I hate to be the bringer of bad news, but when dealing with user permissions, you need to be using some kind of back-end technology.
我讨厌成为坏消息的主播,但在处理用户权限时,您需要使用某种后端技术。
Theoretically, you could store authentication information in the JSON that denoted whether or not a user is an admin, and display the content/assign permissions accordingly. The problem with this technique is that, since the code is on the client side, hacking the admin page would be as easy as altering the JavaScript. This method would provide literally no security whatsoever.
从理论上讲,您可以将身份验证信息存储在JSON中,表示用户是否为管理员,并相应地显示内容/分配权限。这种技术的问题在于,由于代码在客户端,因此破解管理页面就像改变JavaScript一样简单。这种方法几乎没有提供任何安全保障。
If this is okay with you, then go ahead. But I would strongly advise learning some kind of server-side technology.
如果你没事,那就继续吧。但我强烈建议学习某种服务器端技术。
Given that you're a font-end developer, I'm assuming you already know JavaScript, so maybe doing this in Node would be a good option. Node does have a learning curve in and of itself, but knowing JavaScript will help significantly. You'll also need some kind of basic database to store the login information. Some kind of noSQL dialect such as MongoDB would probably work well here.
鉴于你是一个字体端开发人员,我假设你已经知道JavaScript,所以也许在Node中这样做是一个不错的选择。 Node确实具有学习曲线,但知道JavaScript将有很大帮助。您还需要某种基本数据库来存储登录信息。像MongoDB这样的某种noSQL方言可能在这里工作得很好。
For doing advanced permissions, you'd want to use something like LDAP or Active Directory, but for what you're describing this would probably be overkill.
要获得高级权限,您需要使用LDAP或Active Directory之类的东西,但是对于您所描述的内容,这可能会有点过分。
Remember, learning new things is fun! Good luck!
记住,学习新事物很有趣!祝好运!
#1
0
I hate to be the bringer of bad news, but when dealing with user permissions, you need to be using some kind of back-end technology.
我讨厌成为坏消息的主播,但在处理用户权限时,您需要使用某种后端技术。
Theoretically, you could store authentication information in the JSON that denoted whether or not a user is an admin, and display the content/assign permissions accordingly. The problem with this technique is that, since the code is on the client side, hacking the admin page would be as easy as altering the JavaScript. This method would provide literally no security whatsoever.
从理论上讲,您可以将身份验证信息存储在JSON中,表示用户是否为管理员,并相应地显示内容/分配权限。这种技术的问题在于,由于代码在客户端,因此破解管理页面就像改变JavaScript一样简单。这种方法几乎没有提供任何安全保障。
If this is okay with you, then go ahead. But I would strongly advise learning some kind of server-side technology.
如果你没事,那就继续吧。但我强烈建议学习某种服务器端技术。
Given that you're a font-end developer, I'm assuming you already know JavaScript, so maybe doing this in Node would be a good option. Node does have a learning curve in and of itself, but knowing JavaScript will help significantly. You'll also need some kind of basic database to store the login information. Some kind of noSQL dialect such as MongoDB would probably work well here.
鉴于你是一个字体端开发人员,我假设你已经知道JavaScript,所以也许在Node中这样做是一个不错的选择。 Node确实具有学习曲线,但知道JavaScript将有很大帮助。您还需要某种基本数据库来存储登录信息。像MongoDB这样的某种noSQL方言可能在这里工作得很好。
For doing advanced permissions, you'd want to use something like LDAP or Active Directory, but for what you're describing this would probably be overkill.
要获得高级权限,您需要使用LDAP或Active Directory之类的东西,但是对于您所描述的内容,这可能会有点过分。
Remember, learning new things is fun! Good luck!
记住,学习新事物很有趣!祝好运!